import ajax from './index'
// import { append } from './index'
//小店详情
export function shopDetailData(shopId) {
  return ajax.get('/admin/shop/' + shopId + '/detail')
}

//绑定卡号段记录
export function shopBindCardData(shopId,url){
  return ajax.get('/admin/shop/'+ shopId + '/bind_card/search?'+url)
}

//小店-商品记录
export function shopProductData(shopId,url){
  return ajax.get('/admin/shop/'+ shopId + '/product/search?' +url)
}

//小店-爆品记录
export function  shopExplosiveProductData(shopId,url){
  return ajax.get('/admin/shop/' + shopId + '/explosive_product/search?' + url)
}

//小店-活动记录
export function shopActivitySearchData(shopId, url) {
  return ajax.get('/admin/shop/' + shopId + '/activity/search?' + url)
}

//小店-优惠券记录
export function  shopCouponTypeData(shopId,couponType,url){
  return ajax.get('/admin/shop/' + shopId + '/coupon/'+couponType+'/search?' + url)
}

//小店-会员列表
export function  shopVipSearchData(shopId,url){
  return ajax.get('/admin/shop/' + shopId + '/vip/search?'+url)
}

//小店-乐粉列表
export function shopJingFansData(shopId, url) {
  return ajax.get('/admin/shop/' + shopId + '/fans/search?' + url)
}

//小店-开卡列表
export function shopXiCardData(shopId, url) {
  return ajax.get('/admin/shop/' + shopId + '/xi_card/search?' + url)
}

//小店-入驻审核列表
export function  shopEnterAuditData(url){
  return ajax.get('/admin/shop/enter_audit/search?'+url)
}

//小店-入驻审核详情
export function shopEnterAuditDetailData(shopId){
   return ajax.get('/admin/shop/enter_audit/'+shopId+'/detail')
}

//小店-入驻管理列表
export function shopEnterManagerData(url){
   return ajax.get('/admin/shop/enter_manage/search?' + url)
}
// //小店-入驻管理详情
// export function shopEnterManagerDetailData(shopId){
//    return ajax.get('/admin/shop/enter_manage/' + shopId + '/detail')
// }
export const shopEnterManagerDetailData = shopId => {
  return ajax.get(`partner_admin/shop/enter_manage/${shopId}/detail`)
}

//小店-编辑
export function shopUpdateDetailData(shopId,data){
   return ajax.post('/admin/shop/'+shopId+'/update', data)
}

//小店-新增
export function shopCreateDetailData(data){
  return ajax.post('/admin/shop/create', data)
}

//小店-移除
export function shopRemoveDetailData(shopId) {
  return ajax.post('/admin/shop/' + shopId + '/remove')
}

//订单对账状态
export function shopReconciliation(data){
  return ajax.post('/admin/shop/income/reconciliation',data)
}

//检测粉丝
export function shopFansCheck(data){
  return ajax.post('/admin/shop/fans/check', data)
}
//检测合伙人
export function shopPartnerCheck(data){
  return ajax.post('admin/shop/partner/check', data)
}

//小店-资金流水
export function shopAccountIncome(shopId,url){
   return ajax.get('/admin/shop/' + shopId + '/account/search?'+url)
}

//小店确认用户角色
export function userConfirmRole(url){
  return ajax.get('/admin/user/confirm_role?'+url)
}

//小店添加邀请者
export function shopAddInviterWithuserId(data){
  return ajax.post('/admin/shop/add_inviter',data)
}

//小店设为会员
export function shopWithShopIdSetVipShop(id){
  return ajax.post('/admin/shop/'+id+'/set_vip_shop')
}

//红包充值记录
export const cardShopIdRechargeSearch = id => 
{
  return ajax.get(`partner_admin/shop/${id}/recharge/search`)
}

//小店发红包记录
export function shopRedPacketSend(id,url){
  return ajax.get('/admin/shop/'+id+'/red_packet/send?'+url)
}

//小店样式设置
export function shopStyleSetting(shopId,data){
  return ajax.post('/admin/shop/'+shopId+'/style/update',data)
}

//小店-红包的领取用户列表
export function shopRedPacketReceiveUser(url){
  return ajax.get('/admin/shop/red_packet/receive/user?'+url)
}

//小店操作类型
export function shopAdminLogType(){
  return ajax.post('/admin/shop/admin/log/type')
}

//小店操作日志
export function shopAdminLog(data){
  return ajax.post('/admin/shop/admin/log',data)
}

//优惠买单记录
export function  preferentialOrderList(url){
  return ajax.get('/admin/order/preferential_order/list?'+url)
}

//加入小店会员订单列表
export function orderJoinshopViplist(url){
  return ajax.get('/admin/order/join_shop_vip/list?'+url)
}

//加入小店会员详情
export function  orderJoinshopDetail(id){
  return ajax.get('/admin/order/join_shop_vip/detail?id='+id)
}